{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>x1</th>\n",
       "      <th>x2</th>\n",
       "      <th>x3</th>\n",
       "      <th>x4</th>\n",
       "      <th>x5</th>\n",
       "      <th>x6</th>\n",
       "      <th>x7</th>\n",
       "      <th>x8</th>\n",
       "      <th>x9</th>\n",
       "      <th>x10</th>\n",
       "      <th>x11</th>\n",
       "      <th>x12</th>\n",
       "      <th>x13</th>\n",
       "      <th>y</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>1994</th>\n",
       "      <td>3831732</td>\n",
       "      <td>181.54</td>\n",
       "      <td>448.19</td>\n",
       "      <td>7571.00</td>\n",
       "      <td>6212.70</td>\n",
       "      <td>6370241</td>\n",
       "      <td>525.71</td>\n",
       "      <td>985.31</td>\n",
       "      <td>60.62</td>\n",
       "      <td>65.66</td>\n",
       "      <td>120.0</td>\n",
       "      <td>1.029</td>\n",
       "      <td>5321</td>\n",
       "      <td>64.87</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1995</th>\n",
       "      <td>3913824</td>\n",
       "      <td>214.63</td>\n",
       "      <td>549.97</td>\n",
       "      <td>9038.16</td>\n",
       "      <td>7601.73</td>\n",
       "      <td>6467115</td>\n",
       "      <td>618.25</td>\n",
       "      <td>1259.20</td>\n",
       "      <td>73.46</td>\n",
       "      <td>95.46</td>\n",
       "      <td>113.5</td>\n",
       "      <td>1.051</td>\n",
       "      <td>6529</td>\n",
       "      <td>99.75</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1996</th>\n",
       "      <td>3928907</td>\n",
       "      <td>239.56</td>\n",
       "      <td>686.44</td>\n",
       "      <td>9905.31</td>\n",
       "      <td>8092.82</td>\n",
       "      <td>6560508</td>\n",
       "      <td>638.94</td>\n",
       "      <td>1468.06</td>\n",
       "      <td>81.16</td>\n",
       "      <td>81.16</td>\n",
       "      <td>108.2</td>\n",
       "      <td>1.064</td>\n",
       "      <td>7008</td>\n",
       "      <td>88.11</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1997</th>\n",
       "      <td>4282130</td>\n",
       "      <td>261.58</td>\n",
       "      <td>802.59</td>\n",
       "      <td>10444.60</td>\n",
       "      <td>8767.98</td>\n",
       "      <td>6664862</td>\n",
       "      <td>656.58</td>\n",
       "      <td>1678.12</td>\n",
       "      <td>85.72</td>\n",
       "      <td>91.70</td>\n",
       "      <td>102.2</td>\n",
       "      <td>1.092</td>\n",
       "      <td>7694</td>\n",
       "      <td>106.07</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1998</th>\n",
       "      <td>4453911</td>\n",
       "      <td>283.14</td>\n",
       "      <td>904.57</td>\n",
       "      <td>11255.70</td>\n",
       "      <td>9422.33</td>\n",
       "      <td>6741400</td>\n",
       "      <td>758.83</td>\n",
       "      <td>1893.52</td>\n",
       "      <td>88.88</td>\n",
       "      <td>114.61</td>\n",
       "      <td>97.7</td>\n",
       "      <td>1.200</td>\n",
       "      <td>8027</td>\n",
       "      <td>137.32</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1999</th>\n",
       "      <td>4548852</td>\n",
       "      <td>308.58</td>\n",
       "      <td>1000.69</td>\n",
       "      <td>12018.52</td>\n",
       "      <td>9751.44</td>\n",
       "      <td>6850024</td>\n",
       "      <td>878.26</td>\n",
       "      <td>2139.18</td>\n",
       "      <td>92.85</td>\n",
       "      <td>152.78</td>\n",
       "      <td>98.5</td>\n",
       "      <td>1.198</td>\n",
       "      <td>8549</td>\n",
       "      <td>188.14</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000</th>\n",
       "      <td>4962579</td>\n",
       "      <td>348.09</td>\n",
       "      <td>1121.13</td>\n",
       "      <td>13966.53</td>\n",
       "      <td>11349.47</td>\n",
       "      <td>7006896</td>\n",
       "      <td>923.67</td>\n",
       "      <td>2492.74</td>\n",
       "      <td>94.37</td>\n",
       "      <td>170.62</td>\n",
       "      <td>102.8</td>\n",
       "      <td>1.348</td>\n",
       "      <td>9566</td>\n",
       "      <td>219.91</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2001</th>\n",
       "      <td>5029338</td>\n",
       "      <td>387.81</td>\n",
       "      <td>1248.29</td>\n",
       "      <td>14694.00</td>\n",
       "      <td>11467.35</td>\n",
       "      <td>7125979</td>\n",
       "      <td>978.21</td>\n",
       "      <td>2841.65</td>\n",
       "      <td>97.28</td>\n",
       "      <td>214.53</td>\n",
       "      <td>98.9</td>\n",
       "      <td>1.467</td>\n",
       "      <td>10473</td>\n",
       "      <td>271.91</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2002</th>\n",
       "      <td>5070216</td>\n",
       "      <td>453.49</td>\n",
       "      <td>1370.68</td>\n",
       "      <td>13380.47</td>\n",
       "      <td>10671.78</td>\n",
       "      <td>7206229</td>\n",
       "      <td>1009.24</td>\n",
       "      <td>3203.96</td>\n",
       "      <td>103.07</td>\n",
       "      <td>202.18</td>\n",
       "      <td>97.6</td>\n",
       "      <td>1.560</td>\n",
       "      <td>11469</td>\n",
       "      <td>269.10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2003</th>\n",
       "      <td>5210706</td>\n",
       "      <td>533.55</td>\n",
       "      <td>1494.27</td>\n",
       "      <td>15002.59</td>\n",
       "      <td>11570.58</td>\n",
       "      <td>7251888</td>\n",
       "      <td>1175.17</td>\n",
       "      <td>3758.62</td>\n",
       "      <td>109.91</td>\n",
       "      <td>222.51</td>\n",
       "      <td>100.1</td>\n",
       "      <td>1.456</td>\n",
       "      <td>12360</td>\n",
       "      <td>300.55</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2004</th>\n",
       "      <td>5407087</td>\n",
       "      <td>598.33</td>\n",
       "      <td>1677.77</td>\n",
       "      <td>16884.16</td>\n",
       "      <td>13120.83</td>\n",
       "      <td>7376720</td>\n",
       "      <td>1348.93</td>\n",
       "      <td>4450.55</td>\n",
       "      <td>117.15</td>\n",
       "      <td>249.01</td>\n",
       "      <td>101.7</td>\n",
       "      <td>1.424</td>\n",
       "      <td>14174</td>\n",
       "      <td>338.45</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2005</th>\n",
       "      <td>5744550</td>\n",
       "      <td>665.32</td>\n",
       "      <td>1905.84</td>\n",
       "      <td>18287.24</td>\n",
       "      <td>14468.24</td>\n",
       "      <td>7505322</td>\n",
       "      <td>1519.16</td>\n",
       "      <td>5154.23</td>\n",
       "      <td>130.22</td>\n",
       "      <td>303.41</td>\n",
       "      <td>101.5</td>\n",
       "      <td>1.456</td>\n",
       "      <td>16394</td>\n",
       "      <td>408.86</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2006</th>\n",
       "      <td>5994973</td>\n",
       "      <td>738.97</td>\n",
       "      <td>2199.14</td>\n",
       "      <td>19850.66</td>\n",
       "      <td>15444.93</td>\n",
       "      <td>7607220</td>\n",
       "      <td>1696.38</td>\n",
       "      <td>6081.86</td>\n",
       "      <td>128.51</td>\n",
       "      <td>356.99</td>\n",
       "      <td>102.3</td>\n",
       "      <td>1.438</td>\n",
       "      <td>17881</td>\n",
       "      <td>476.72</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2007</th>\n",
       "      <td>6236312</td>\n",
       "      <td>877.07</td>\n",
       "      <td>2624.24</td>\n",
       "      <td>22469.22</td>\n",
       "      <td>18951.32</td>\n",
       "      <td>7734787</td>\n",
       "      <td>1863.34</td>\n",
       "      <td>7140.32</td>\n",
       "      <td>149.87</td>\n",
       "      <td>429.36</td>\n",
       "      <td>103.4</td>\n",
       "      <td>1.474</td>\n",
       "      <td>20058</td>\n",
       "      <td>838.99</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2008</th>\n",
       "      <td>6529045</td>\n",
       "      <td>1005.37</td>\n",
       "      <td>3187.39</td>\n",
       "      <td>25316.72</td>\n",
       "      <td>20835.95</td>\n",
       "      <td>7841695</td>\n",
       "      <td>2105.54</td>\n",
       "      <td>8287.38</td>\n",
       "      <td>169.19</td>\n",
       "      <td>508.84</td>\n",
       "      <td>105.9</td>\n",
       "      <td>1.515</td>\n",
       "      <td>22114</td>\n",
       "      <td>843.14</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2009</th>\n",
       "      <td>6791495</td>\n",
       "      <td>1118.03</td>\n",
       "      <td>3615.77</td>\n",
       "      <td>27609.59</td>\n",
       "      <td>22820.89</td>\n",
       "      <td>7946154</td>\n",
       "      <td>2659.85</td>\n",
       "      <td>9138.21</td>\n",
       "      <td>172.28</td>\n",
       "      <td>557.74</td>\n",
       "      <td>97.5</td>\n",
       "      <td>1.633</td>\n",
       "      <td>24190</td>\n",
       "      <td>1107.67</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2010</th>\n",
       "      <td>7110695</td>\n",
       "      <td>1304.48</td>\n",
       "      <td>4476.38</td>\n",
       "      <td>30658.49</td>\n",
       "      <td>25011.61</td>\n",
       "      <td>8061370</td>\n",
       "      <td>3263.57</td>\n",
       "      <td>10748.28</td>\n",
       "      <td>188.57</td>\n",
       "      <td>664.06</td>\n",
       "      <td>103.2</td>\n",
       "      <td>1.638</td>\n",
       "      <td>29549</td>\n",
       "      <td>1399.16</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2011</th>\n",
       "      <td>7431755</td>\n",
       "      <td>1700.87</td>\n",
       "      <td>5243.03</td>\n",
       "      <td>34438.08</td>\n",
       "      <td>28209.74</td>\n",
       "      <td>8145797</td>\n",
       "      <td>3412.21</td>\n",
       "      <td>12423.44</td>\n",
       "      <td>204.54</td>\n",
       "      <td>710.66</td>\n",
       "      <td>105.5</td>\n",
       "      <td>1.670</td>\n",
       "      <td>34214</td>\n",
       "      <td>1535.14</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2012</th>\n",
       "      <td>7512997</td>\n",
       "      <td>1969.51</td>\n",
       "      <td>5977.27</td>\n",
       "      <td>38053.52</td>\n",
       "      <td>30490.44</td>\n",
       "      <td>8222969</td>\n",
       "      <td>3758.39</td>\n",
       "      <td>13551.21</td>\n",
       "      <td>213.76</td>\n",
       "      <td>760.49</td>\n",
       "      <td>103.0</td>\n",
       "      <td>1.825</td>\n",
       "      <td>37934</td>\n",
       "      <td>1579.68</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2013</th>\n",
       "      <td>7599295</td>\n",
       "      <td>2110.78</td>\n",
       "      <td>6882.85</td>\n",
       "      <td>42049.14</td>\n",
       "      <td>33156.83</td>\n",
       "      <td>8323096</td>\n",
       "      <td>4454.55</td>\n",
       "      <td>15420.14</td>\n",
       "      <td>228.46</td>\n",
       "      <td>852.56</td>\n",
       "      <td>102.6</td>\n",
       "      <td>1.906</td>\n",
       "      <td>41972</td>\n",
       "      <td>2088.14</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "           x1       x2       x3        x4        x5       x6       x7  \\\n",
       "1994  3831732   181.54   448.19   7571.00   6212.70  6370241   525.71   \n",
       "1995  3913824   214.63   549.97   9038.16   7601.73  6467115   618.25   \n",
       "1996  3928907   239.56   686.44   9905.31   8092.82  6560508   638.94   \n",
       "1997  4282130   261.58   802.59  10444.60   8767.98  6664862   656.58   \n",
       "1998  4453911   283.14   904.57  11255.70   9422.33  6741400   758.83   \n",
       "1999  4548852   308.58  1000.69  12018.52   9751.44  6850024   878.26   \n",
       "2000  4962579   348.09  1121.13  13966.53  11349.47  7006896   923.67   \n",
       "2001  5029338   387.81  1248.29  14694.00  11467.35  7125979   978.21   \n",
       "2002  5070216   453.49  1370.68  13380.47  10671.78  7206229  1009.24   \n",
       "2003  5210706   533.55  1494.27  15002.59  11570.58  7251888  1175.17   \n",
       "2004  5407087   598.33  1677.77  16884.16  13120.83  7376720  1348.93   \n",
       "2005  5744550   665.32  1905.84  18287.24  14468.24  7505322  1519.16   \n",
       "2006  5994973   738.97  2199.14  19850.66  15444.93  7607220  1696.38   \n",
       "2007  6236312   877.07  2624.24  22469.22  18951.32  7734787  1863.34   \n",
       "2008  6529045  1005.37  3187.39  25316.72  20835.95  7841695  2105.54   \n",
       "2009  6791495  1118.03  3615.77  27609.59  22820.89  7946154  2659.85   \n",
       "2010  7110695  1304.48  4476.38  30658.49  25011.61  8061370  3263.57   \n",
       "2011  7431755  1700.87  5243.03  34438.08  28209.74  8145797  3412.21   \n",
       "2012  7512997  1969.51  5977.27  38053.52  30490.44  8222969  3758.39   \n",
       "2013  7599295  2110.78  6882.85  42049.14  33156.83  8323096  4454.55   \n",
       "\n",
       "            x8      x9     x10    x11    x12    x13        y  \n",
       "1994    985.31   60.62   65.66  120.0  1.029   5321    64.87  \n",
       "1995   1259.20   73.46   95.46  113.5  1.051   6529    99.75  \n",
       "1996   1468.06   81.16   81.16  108.2  1.064   7008    88.11  \n",
       "1997   1678.12   85.72   91.70  102.2  1.092   7694   106.07  \n",
       "1998   1893.52   88.88  114.61   97.7  1.200   8027   137.32  \n",
       "1999   2139.18   92.85  152.78   98.5  1.198   8549   188.14  \n",
       "2000   2492.74   94.37  170.62  102.8  1.348   9566   219.91  \n",
       "2001   2841.65   97.28  214.53   98.9  1.467  10473   271.91  \n",
       "2002   3203.96  103.07  202.18   97.6  1.560  11469   269.10  \n",
       "2003   3758.62  109.91  222.51  100.1  1.456  12360   300.55  \n",
       "2004   4450.55  117.15  249.01  101.7  1.424  14174   338.45  \n",
       "2005   5154.23  130.22  303.41  101.5  1.456  16394   408.86  \n",
       "2006   6081.86  128.51  356.99  102.3  1.438  17881   476.72  \n",
       "2007   7140.32  149.87  429.36  103.4  1.474  20058   838.99  \n",
       "2008   8287.38  169.19  508.84  105.9  1.515  22114   843.14  \n",
       "2009   9138.21  172.28  557.74   97.5  1.633  24190  1107.67  \n",
       "2010  10748.28  188.57  664.06  103.2  1.638  29549  1399.16  \n",
       "2011  12423.44  204.54  710.66  105.5  1.670  34214  1535.14  \n",
       "2012  13551.21  213.76  760.49  103.0  1.825  37934  1579.68  \n",
       "2013  15420.14  228.46  852.56  102.6  1.906  41972  2088.14  "
      ]
     },
     "execution_count": 1,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#-*- coding:utf-8 -*-\n",
    "# 2_1 某市财政收入预测模型\n",
    "# 灰色预测：灰色预测是一种对含有不确定因素的系统进行预测的方法，灰色预测通过鉴别系统因素之间发展趋势的相异程度，即进行关联分析，\n",
    "# 并对原始数据进行生成处理来寻找系统变动的规律，生成有较强规律性的数据序列，然后建立相应的微分方程模型，从而预测事物未来发展趋势的状况。\n",
    "# 其用等时距观测到的反应预测对象特征的一系列数量值构造灰色预测模型，预测未来某一时刻的特征量，或达到某一特征量的时间。\n",
    "# 灰色理论建立的是生成数据模型，不是原始数据模型\n",
    "# 数据生成方式：A：累加生成：通过数列间各时刻数据的依个累加得到新的数据与数列。累加前数列为原始数列，累加后为生成数列。B：累减生成 C：其他\n",
    "# 优势：是处理小样本数据预测问题的有效工具\n",
    "import pandas as pd\n",
    "import numpy as np\n",
    "from GM11 import GM11 # 引入自己编写的灰色预测函数\n",
    "\n",
    "inputfile1 = 'data1.csv'\n",
    "\n",
    "data = pd.read_csv(inputfile1)\n",
    "data.index = range(1994,2014)\n",
    "data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "#-*- coding: utf-8 -*-\n",
    "# 灰色预测函数\n",
    "def GM11(x0): #自定义灰色预测函数  #该函数覆盖了导入的包的同名函数\n",
    "    import numpy as np\n",
    "    x1 = x0.cumsum() #1-AGO序列\n",
    "    z1 = (x1[:len(x1)-1] + x1[1:])/2.0 #紧邻均值（MEAN）生成序列 # 由常微分方程可知，取前后两个时刻的值的平均值代替更为合理\n",
    "    # x0[1] = -1/2.0*(x1[1] + x1[0])\n",
    "    z1 = z1.reshape((len(z1),1))\n",
    "    B = np.append(-z1, np.ones_like(z1), axis = 1) # (***)\n",
    "    Yn = x0[1:].reshape((len(x0)-1, 1))\n",
    "    [[a],[b]] = np.dot(np.dot(np.linalg.inv(np.dot(B.T, B)), B.T), Yn) #计算参数\n",
    "#     fkplusone = (x1[0]-b/a)*np.exp(-a*k)#时间响应方程 # 由于x0[0] = x1[0]\n",
    "    f = lambda k: (x1[0]-b/a)*np.exp(-a*(k-1))-(x1[0]-b/a)*np.exp(-a*(k-2)) #还原值 \n",
    "    delta = np.abs(x0 - np.array([f(i) for i in range(1,len(x0)+1)])) # 残差\n",
    "    C = delta.std()/x0.std() # 后验比差值\n",
    "    P = 1.0*(np.abs(delta - delta.mean()) < 0.6745*x0.std()).sum()/len(x0)\n",
    "    return f, a, b, x0[0], C, P #返回灰色预测函数、a、b、首项、方差比、小残差概率"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "对于模型x1，该模型精度为---好\n",
      "对于模型x2，该模型精度为---好\n",
      "对于模型x3，该模型精度为---好\n",
      "对于模型x4，该模型精度为---好\n",
      "对于模型x5，该模型精度为---好\n",
      "对于模型x7，该模型精度为---好\n"
     ]
    }
   ],
   "source": [
    "data.loc[2014] = None\n",
    "data.loc[2015] = None\n",
    "h = ['x1', 'x2', 'x3', 'x4', 'x5', 'x7']\n",
    "P = []\n",
    "C = []\n",
    "for i in h:\n",
    "    gm = GM11(data[i][range(1994, 2014)].as_matrix())\n",
    "    f = gm[0] ##获得灰色预测函数\n",
    "    P = gm[-1] # 获得小残差概率\n",
    "    C = gm[-2] # 获得后验比差值\n",
    "    data[i][2014] = f(len(data)-1)\n",
    "    data[i][2015] = f(len(data))\n",
    "    data[i] = data[i].round(2) # 保留2位小数\n",
    "    if (C < 0.35 and P > 0.95): # 评测后验差判别\n",
    "        print '对于模型%s，该模型精度为---好' % i\n",
    "    elif (C < 0.5 and P > 0.8):\n",
    "        print '对于模型%s，该模型精度为---合格' % i\n",
    "    elif (C < 0.65 and P > 0.7):\n",
    "        print '对于模型%s，该模型精度为---勉强合格' % i\n",
    "    else:\n",
    "        print '对于模型%s，该模型精度为---不合格' % i"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "#保存的表名命名格式为“2_1_2_1k此表功能名称”，是此小节生成的第1张表格，功能为greyPredict：灰色预测\n",
    "\n",
    "data[h+['y']].to_excel('2_1_2_1greyPredict.xlsx')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>x1</th>\n",
       "      <th>x2</th>\n",
       "      <th>x3</th>\n",
       "      <th>x4</th>\n",
       "      <th>x5</th>\n",
       "      <th>x6</th>\n",
       "      <th>x7</th>\n",
       "      <th>x8</th>\n",
       "      <th>x9</th>\n",
       "      <th>x10</th>\n",
       "      <th>x11</th>\n",
       "      <th>x12</th>\n",
       "      <th>x13</th>\n",
       "      <th>y</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>1994</th>\n",
       "      <td>3831732.00</td>\n",
       "      <td>181.54</td>\n",
       "      <td>448.19</td>\n",
       "      <td>7571.00</td>\n",
       "      <td>6212.70</td>\n",
       "      <td>6370241.0</td>\n",
       "      <td>525.71</td>\n",
       "      <td>985.31</td>\n",
       "      <td>60.62</td>\n",
       "      <td>65.66</td>\n",
       "      <td>120.0</td>\n",
       "      <td>1.029</td>\n",
       "      <td>5321.0</td>\n",
       "      <td>64.87</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1995</th>\n",
       "      <td>3913824.00</td>\n",
       "      <td>214.63</td>\n",
       "      <td>549.97</td>\n",
       "      <td>9038.16</td>\n",
       "      <td>7601.73</td>\n",
       "      <td>6467115.0</td>\n",
       "      <td>618.25</td>\n",
       "      <td>1259.20</td>\n",
       "      <td>73.46</td>\n",
       "      <td>95.46</td>\n",
       "      <td>113.5</td>\n",
       "      <td>1.051</td>\n",
       "      <td>6529.0</td>\n",
       "      <td>99.75</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1996</th>\n",
       "      <td>3928907.00</td>\n",
       "      <td>239.56</td>\n",
       "      <td>686.44</td>\n",
       "      <td>9905.31</td>\n",
       "      <td>8092.82</td>\n",
       "      <td>6560508.0</td>\n",
       "      <td>638.94</td>\n",
       "      <td>1468.06</td>\n",
       "      <td>81.16</td>\n",
       "      <td>81.16</td>\n",
       "      <td>108.2</td>\n",
       "      <td>1.064</td>\n",
       "      <td>7008.0</td>\n",
       "      <td>88.11</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1997</th>\n",
       "      <td>4282130.00</td>\n",
       "      <td>261.58</td>\n",
       "      <td>802.59</td>\n",
       "      <td>10444.60</td>\n",
       "      <td>8767.98</td>\n",
       "      <td>6664862.0</td>\n",
       "      <td>656.58</td>\n",
       "      <td>1678.12</td>\n",
       "      <td>85.72</td>\n",
       "      <td>91.70</td>\n",
       "      <td>102.2</td>\n",
       "      <td>1.092</td>\n",
       "      <td>7694.0</td>\n",
       "      <td>106.07</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1998</th>\n",
       "      <td>4453911.00</td>\n",
       "      <td>283.14</td>\n",
       "      <td>904.57</td>\n",
       "      <td>11255.70</td>\n",
       "      <td>9422.33</td>\n",
       "      <td>6741400.0</td>\n",
       "      <td>758.83</td>\n",
       "      <td>1893.52</td>\n",
       "      <td>88.88</td>\n",
       "      <td>114.61</td>\n",
       "      <td>97.7</td>\n",
       "      <td>1.200</td>\n",
       "      <td>8027.0</td>\n",
       "      <td>137.32</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1999</th>\n",
       "      <td>4548852.00</td>\n",
       "      <td>308.58</td>\n",
       "      <td>1000.69</td>\n",
       "      <td>12018.52</td>\n",
       "      <td>9751.44</td>\n",
       "      <td>6850024.0</td>\n",
       "      <td>878.26</td>\n",
       "      <td>2139.18</td>\n",
       "      <td>92.85</td>\n",
       "      <td>152.78</td>\n",
       "      <td>98.5</td>\n",
       "      <td>1.198</td>\n",
       "      <td>8549.0</td>\n",
       "      <td>188.14</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000</th>\n",
       "      <td>4962579.00</td>\n",
       "      <td>348.09</td>\n",
       "      <td>1121.13</td>\n",
       "      <td>13966.53</td>\n",
       "      <td>11349.47</td>\n",
       "      <td>7006896.0</td>\n",
       "      <td>923.67</td>\n",
       "      <td>2492.74</td>\n",
       "      <td>94.37</td>\n",
       "      <td>170.62</td>\n",
       "      <td>102.8</td>\n",
       "      <td>1.348</td>\n",
       "      <td>9566.0</td>\n",
       "      <td>219.91</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2001</th>\n",
       "      <td>5029338.00</td>\n",
       "      <td>387.81</td>\n",
       "      <td>1248.29</td>\n",
       "      <td>14694.00</td>\n",
       "      <td>11467.35</td>\n",
       "      <td>7125979.0</td>\n",
       "      <td>978.21</td>\n",
       "      <td>2841.65</td>\n",
       "      <td>97.28</td>\n",
       "      <td>214.53</td>\n",
       "      <td>98.9</td>\n",
       "      <td>1.467</td>\n",
       "      <td>10473.0</td>\n",
       "      <td>271.91</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2002</th>\n",
       "      <td>5070216.00</td>\n",
       "      <td>453.49</td>\n",
       "      <td>1370.68</td>\n",
       "      <td>13380.47</td>\n",
       "      <td>10671.78</td>\n",
       "      <td>7206229.0</td>\n",
       "      <td>1009.24</td>\n",
       "      <td>3203.96</td>\n",
       "      <td>103.07</td>\n",
       "      <td>202.18</td>\n",
       "      <td>97.6</td>\n",
       "      <td>1.560</td>\n",
       "      <td>11469.0</td>\n",
       "      <td>269.10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2003</th>\n",
       "      <td>5210706.00</td>\n",
       "      <td>533.55</td>\n",
       "      <td>1494.27</td>\n",
       "      <td>15002.59</td>\n",
       "      <td>11570.58</td>\n",
       "      <td>7251888.0</td>\n",
       "      <td>1175.17</td>\n",
       "      <td>3758.62</td>\n",
       "      <td>109.91</td>\n",
       "      <td>222.51</td>\n",
       "      <td>100.1</td>\n",
       "      <td>1.456</td>\n",
       "      <td>12360.0</td>\n",
       "      <td>300.55</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2004</th>\n",
       "      <td>5407087.00</td>\n",
       "      <td>598.33</td>\n",
       "      <td>1677.77</td>\n",
       "      <td>16884.16</td>\n",
       "      <td>13120.83</td>\n",
       "      <td>7376720.0</td>\n",
       "      <td>1348.93</td>\n",
       "      <td>4450.55</td>\n",
       "      <td>117.15</td>\n",
       "      <td>249.01</td>\n",
       "      <td>101.7</td>\n",
       "      <td>1.424</td>\n",
       "      <td>14174.0</td>\n",
       "      <td>338.45</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2005</th>\n",
       "      <td>5744550.00</td>\n",
       "      <td>665.32</td>\n",
       "      <td>1905.84</td>\n",
       "      <td>18287.24</td>\n",
       "      <td>14468.24</td>\n",
       "      <td>7505322.0</td>\n",
       "      <td>1519.16</td>\n",
       "      <td>5154.23</td>\n",
       "      <td>130.22</td>\n",
       "      <td>303.41</td>\n",
       "      <td>101.5</td>\n",
       "      <td>1.456</td>\n",
       "      <td>16394.0</td>\n",
       "      <td>408.86</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2006</th>\n",
       "      <td>5994973.00</td>\n",
       "      <td>738.97</td>\n",
       "      <td>2199.14</td>\n",
       "      <td>19850.66</td>\n",
       "      <td>15444.93</td>\n",
       "      <td>7607220.0</td>\n",
       "      <td>1696.38</td>\n",
       "      <td>6081.86</td>\n",
       "      <td>128.51</td>\n",
       "      <td>356.99</td>\n",
       "      <td>102.3</td>\n",
       "      <td>1.438</td>\n",
       "      <td>17881.0</td>\n",
       "      <td>476.72</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2007</th>\n",
       "      <td>6236312.00</td>\n",
       "      <td>877.07</td>\n",
       "      <td>2624.24</td>\n",
       "      <td>22469.22</td>\n",
       "      <td>18951.32</td>\n",
       "      <td>7734787.0</td>\n",
       "      <td>1863.34</td>\n",
       "      <td>7140.32</td>\n",
       "      <td>149.87</td>\n",
       "      <td>429.36</td>\n",
       "      <td>103.4</td>\n",
       "      <td>1.474</td>\n",
       "      <td>20058.0</td>\n",
       "      <td>838.99</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2008</th>\n",
       "      <td>6529045.00</td>\n",
       "      <td>1005.37</td>\n",
       "      <td>3187.39</td>\n",
       "      <td>25316.72</td>\n",
       "      <td>20835.95</td>\n",
       "      <td>7841695.0</td>\n",
       "      <td>2105.54</td>\n",
       "      <td>8287.38</td>\n",
       "      <td>169.19</td>\n",
       "      <td>508.84</td>\n",
       "      <td>105.9</td>\n",
       "      <td>1.515</td>\n",
       "      <td>22114.0</td>\n",
       "      <td>843.14</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2009</th>\n",
       "      <td>6791495.00</td>\n",
       "      <td>1118.03</td>\n",
       "      <td>3615.77</td>\n",
       "      <td>27609.59</td>\n",
       "      <td>22820.89</td>\n",
       "      <td>7946154.0</td>\n",
       "      <td>2659.85</td>\n",
       "      <td>9138.21</td>\n",
       "      <td>172.28</td>\n",
       "      <td>557.74</td>\n",
       "      <td>97.5</td>\n",
       "      <td>1.633</td>\n",
       "      <td>24190.0</td>\n",
       "      <td>1107.67</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2010</th>\n",
       "      <td>7110695.00</td>\n",
       "      <td>1304.48</td>\n",
       "      <td>4476.38</td>\n",
       "      <td>30658.49</td>\n",
       "      <td>25011.61</td>\n",
       "      <td>8061370.0</td>\n",
       "      <td>3263.57</td>\n",
       "      <td>10748.28</td>\n",
       "      <td>188.57</td>\n",
       "      <td>664.06</td>\n",
       "      <td>103.2</td>\n",
       "      <td>1.638</td>\n",
       "      <td>29549.0</td>\n",
       "      <td>1399.16</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2011</th>\n",
       "      <td>7431755.00</td>\n",
       "      <td>1700.87</td>\n",
       "      <td>5243.03</td>\n",
       "      <td>34438.08</td>\n",
       "      <td>28209.74</td>\n",
       "      <td>8145797.0</td>\n",
       "      <td>3412.21</td>\n",
       "      <td>12423.44</td>\n",
       "      <td>204.54</td>\n",
       "      <td>710.66</td>\n",
       "      <td>105.5</td>\n",
       "      <td>1.670</td>\n",
       "      <td>34214.0</td>\n",
       "      <td>1535.14</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2012</th>\n",
       "      <td>7512997.00</td>\n",
       "      <td>1969.51</td>\n",
       "      <td>5977.27</td>\n",
       "      <td>38053.52</td>\n",
       "      <td>30490.44</td>\n",
       "      <td>8222969.0</td>\n",
       "      <td>3758.39</td>\n",
       "      <td>13551.21</td>\n",
       "      <td>213.76</td>\n",
       "      <td>760.49</td>\n",
       "      <td>103.0</td>\n",
       "      <td>1.825</td>\n",
       "      <td>37934.0</td>\n",
       "      <td>1579.68</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2013</th>\n",
       "      <td>7599295.00</td>\n",
       "      <td>2110.78</td>\n",
       "      <td>6882.85</td>\n",
       "      <td>42049.14</td>\n",
       "      <td>33156.83</td>\n",
       "      <td>8323096.0</td>\n",
       "      <td>4454.55</td>\n",
       "      <td>15420.14</td>\n",
       "      <td>228.46</td>\n",
       "      <td>852.56</td>\n",
       "      <td>102.6</td>\n",
       "      <td>1.906</td>\n",
       "      <td>41972.0</td>\n",
       "      <td>2088.14</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2014</th>\n",
       "      <td>8142148.24</td>\n",
       "      <td>2239.29</td>\n",
       "      <td>7042.31</td>\n",
       "      <td>43611.84</td>\n",
       "      <td>35046.63</td>\n",
       "      <td>NaN</td>\n",
       "      <td>4600.40</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2015</th>\n",
       "      <td>8460489.28</td>\n",
       "      <td>2581.14</td>\n",
       "      <td>8166.92</td>\n",
       "      <td>47792.22</td>\n",
       "      <td>38384.22</td>\n",
       "      <td>NaN</td>\n",
       "      <td>5214.78</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "              x1       x2       x3        x4        x5         x6       x7  \\\n",
       "1994  3831732.00   181.54   448.19   7571.00   6212.70  6370241.0   525.71   \n",
       "1995  3913824.00   214.63   549.97   9038.16   7601.73  6467115.0   618.25   \n",
       "1996  3928907.00   239.56   686.44   9905.31   8092.82  6560508.0   638.94   \n",
       "1997  4282130.00   261.58   802.59  10444.60   8767.98  6664862.0   656.58   \n",
       "1998  4453911.00   283.14   904.57  11255.70   9422.33  6741400.0   758.83   \n",
       "1999  4548852.00   308.58  1000.69  12018.52   9751.44  6850024.0   878.26   \n",
       "2000  4962579.00   348.09  1121.13  13966.53  11349.47  7006896.0   923.67   \n",
       "2001  5029338.00   387.81  1248.29  14694.00  11467.35  7125979.0   978.21   \n",
       "2002  5070216.00   453.49  1370.68  13380.47  10671.78  7206229.0  1009.24   \n",
       "2003  5210706.00   533.55  1494.27  15002.59  11570.58  7251888.0  1175.17   \n",
       "2004  5407087.00   598.33  1677.77  16884.16  13120.83  7376720.0  1348.93   \n",
       "2005  5744550.00   665.32  1905.84  18287.24  14468.24  7505322.0  1519.16   \n",
       "2006  5994973.00   738.97  2199.14  19850.66  15444.93  7607220.0  1696.38   \n",
       "2007  6236312.00   877.07  2624.24  22469.22  18951.32  7734787.0  1863.34   \n",
       "2008  6529045.00  1005.37  3187.39  25316.72  20835.95  7841695.0  2105.54   \n",
       "2009  6791495.00  1118.03  3615.77  27609.59  22820.89  7946154.0  2659.85   \n",
       "2010  7110695.00  1304.48  4476.38  30658.49  25011.61  8061370.0  3263.57   \n",
       "2011  7431755.00  1700.87  5243.03  34438.08  28209.74  8145797.0  3412.21   \n",
       "2012  7512997.00  1969.51  5977.27  38053.52  30490.44  8222969.0  3758.39   \n",
       "2013  7599295.00  2110.78  6882.85  42049.14  33156.83  8323096.0  4454.55   \n",
       "2014  8142148.24  2239.29  7042.31  43611.84  35046.63        NaN  4600.40   \n",
       "2015  8460489.28  2581.14  8166.92  47792.22  38384.22        NaN  5214.78   \n",
       "\n",
       "            x8      x9     x10    x11    x12      x13        y  \n",
       "1994    985.31   60.62   65.66  120.0  1.029   5321.0    64.87  \n",
       "1995   1259.20   73.46   95.46  113.5  1.051   6529.0    99.75  \n",
       "1996   1468.06   81.16   81.16  108.2  1.064   7008.0    88.11  \n",
       "1997   1678.12   85.72   91.70  102.2  1.092   7694.0   106.07  \n",
       "1998   1893.52   88.88  114.61   97.7  1.200   8027.0   137.32  \n",
       "1999   2139.18   92.85  152.78   98.5  1.198   8549.0   188.14  \n",
       "2000   2492.74   94.37  170.62  102.8  1.348   9566.0   219.91  \n",
       "2001   2841.65   97.28  214.53   98.9  1.467  10473.0   271.91  \n",
       "2002   3203.96  103.07  202.18   97.6  1.560  11469.0   269.10  \n",
       "2003   3758.62  109.91  222.51  100.1  1.456  12360.0   300.55  \n",
       "2004   4450.55  117.15  249.01  101.7  1.424  14174.0   338.45  \n",
       "2005   5154.23  130.22  303.41  101.5  1.456  16394.0   408.86  \n",
       "2006   6081.86  128.51  356.99  102.3  1.438  17881.0   476.72  \n",
       "2007   7140.32  149.87  429.36  103.4  1.474  20058.0   838.99  \n",
       "2008   8287.38  169.19  508.84  105.9  1.515  22114.0   843.14  \n",
       "2009   9138.21  172.28  557.74   97.5  1.633  24190.0  1107.67  \n",
       "2010  10748.28  188.57  664.06  103.2  1.638  29549.0  1399.16  \n",
       "2011  12423.44  204.54  710.66  105.5  1.670  34214.0  1535.14  \n",
       "2012  13551.21  213.76  760.49  103.0  1.825  37934.0  1579.68  \n",
       "2013  15420.14  228.46  852.56  102.6  1.906  41972.0  2088.14  \n",
       "2014       NaN     NaN     NaN    NaN    NaN      NaN      NaN  \n",
       "2015       NaN     NaN     NaN    NaN    NaN      NaN      NaN  "
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "python2"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.13"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
